Skip to content

Conversation

@KJ7LNW
Copy link
Contributor

@KJ7LNW KJ7LNW commented Apr 8, 2025

Context

All of these are system instruction or model feedback changes, no actual program changes:

This PR addresses confusion between the VS Code workspace directory and terminal working directory. Roo was not properly distinguishing between these concepts, leading to issues when terminal commands changed directories.

The problem occurs when users run commands that change directories (like 'cd') in a terminal. Roo would continue to reference the original workspace directory in subsequent commands, even though the terminal's working directory had changed. This led to commands failing because they were being executed in the wrong directory.

For example, as described in this Reddit post (https://www.reddit.com/r/RooCode/s/6L19EvsFbF), a user would:

  1. Create a directory: 'mkdir -p aws-lambda/foo'
  2. Change to that directory: 'cd aws-lambda/foo && npm init -y'
  3. Try to run another command in that directory: 'cd aws-lambda/foo && npm install aws-sdk'

The third command would fail because Roo didn't understand that the terminal was already in the 'aws-lambda/foo' directory after the second command. Roo would try to change directories again, resulting in an error.

Changes

This PR makes the following high-level changes:

  1. Clarifies terminology by distinguishing between:

    • The fixed VS Code project directory (now called 'workspace directory')
    • The changeable terminal directory (called 'working directory')
  2. Improves user feedback when terminal directory changes occur

  3. Enhances documentation to explain the difference between these concepts

How to Test

  1. Start a conversation with Roo
  2. Ask Roo to run a Jest test in a specific directory:

Found 1 test suites
.........
Ran 9 tests in 0.196 s
9 passing 0 failing 0 pending
3. When the test completes, simply tell Roo 'again'
4. Verify that Roo correctly understands it's already in the right directory and runs the test directly without trying to change directories again
5. This has been tested successfully on the following models:

  • Claude 3.5 Sonnet
  • Claude 3.7 Sonnet
  • Gemini 2.5 Pro

image

Get in Touch

Discord: KJ7LNW


Important

Fixes terminal working directory handling in Cline.ts and clarifies workspace vs. working directory terminology across multiple files.

  • Behavior:
    • Updates Cline.ts to correctly handle changes in terminal working directory and provide user feedback when directory changes occur.
    • Removes incorrect workspace directory reference in task resumption message in Cline.ts.
  • Terminology:
    • Renames 'current working directory' to 'current workspace directory' in multi-search-replace.ts, capabilities.ts, system-info.ts, insert-content.ts, list-files.ts, read-file.ts, search-and-replace.ts, search-files.ts, and write-to-file.ts.
  • Documentation:
    • Enhances documentation in system-info.ts to explain the difference between workspace and working directories.

This description was created by Ellipsis for 4f17daf. It will automatically update as commits are pushed.

Eric Wheeler added 2 commits April 8, 2025 14:21
…ing directory

This commit addresses confusion between the VS Code workspace directory and
terminal working directory. Roo was not properly distinguishing between these
concepts, leading to issues when terminal commands changed directories.

- Renamed 'Current Working Directory' to 'Current Workspace Directory' throughout
- Added clearer notice when a command changes the working directory in a terminal
- Added explanation about the difference between workspace and working directories
- Updated all tool descriptions to reference 'workspace directory'

References: https://www.reddit.com/r/RooCode/s/6L19EvsFbF
Signed-off-by: Eric Wheeler <[email protected]>
Update terminology from 'working directory' to 'workspace directory' in tests
to reflect VSCode's concept of workspace vs working directory.

Signed-off-by: Eric Wheeler <[email protected]>
@changeset-bot
Copy link

changeset-bot bot commented Apr 8, 2025

⚠️ No Changeset found

Latest commit: 4f17daf

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working documentation Improvements or additions to documentation and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Apr 8, 2025
@adamhill
Copy link
Contributor

adamhill commented Apr 9, 2025

Something in me wants to name one of them something totally differently without the word "work" in both.

I can just see the quantized LLM measuring the Levenshtein distance between the two paths and still getting it wrong :-)

@KJ7LNW
Copy link
Contributor Author

KJ7LNW commented Apr 9, 2025

Something in me wants to name one of them something totally differently without the word "work" in both.

I can just see the quantized LLM measuring the Levenshtein distance between the two paths and still getting it wrong :-)

This PR solves existing an ongoing issues that affect many people. The reason that I chose the word "workspace" is because it is the term used by vs code, so it is likely to be part of training corpus.

These changes seem to work well for the models that were tested, and I think we should get this merged to solve existing known problems (instead of deferring because of future unknown problems).

Even for quantized models, this change will only improve the response. If naming uniqueness is not quite far enough apart, and you discover an actual specific issue then I think that should be handled as a second pull request.

I am not dismissing your suggestion, I think it would be great to have inexpensive models work well inside of Roo, however in the sense of triage, this is more about stopping the bleeding and then dealing with nice-to-haves at another time.

@KJ7LNW
Copy link
Contributor Author

KJ7LNW commented Apr 9, 2025

@hannesrudolph @mrubens @cte

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Apr 9, 2025
@mrubens mrubens merged commit 2779e8f into RooCodeInc:main Apr 9, 2025
20 checks passed
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants